package ln.fxspringarchetype.controller.course;

import javafx.beans.binding.Bindings;
import javafx.fxml.FXML;
import javafx.scene.control.Label;
import ln.fxspringarchetype.controller.BaseFxController;
import ln.fxspringarchetype.vo.CourseVO;

public class DeleteCourseController extends BaseFxController {
    private final CourseVO courseVO = new CourseVO();
    @FXML
    private Label idLabel;
    @FXML
    private Label creditLabel;
    @FXML
    private Label descriptionLabel;
    @FXML
    private Label nameLabel;

    public CourseVO getCourseVO() {
        return courseVO;
    }

    @Override
    public void setCellValueFactories() {

    }

    @Override
    public void setCellFactories() {

    }

    @Override
    public void createBindings() {
        idLabel.textProperty().bind(
                Bindings.createStringBinding(
                        () -> Integer.toString(courseVO.getId()), courseVO.idProperty()));
        nameLabel.textProperty().bind(courseVO.nameProperty());
        descriptionLabel.textProperty().bind(courseVO.descriptionProperty());
        creditLabel.textProperty().bind(
                Bindings.createStringBinding(() ->
                        String.valueOf(courseVO.getCredit()), courseVO.creditProperty()));
    }

    @Override
    public void initLayout() {
    }

    @Override
    public void loadData() {

    }
}
